package FirstProject;

import java.text.SimpleDateFormat;
import java.util.Date;

import java.text.SimpleDateFormat;
import java.util.Date;

public class ConsumeInfo {
    private String cardNumber;    // 卡号
    private String type;         // 消费类型：通话/短信/上网
    private int consumeData;      // 消费数据量(分钟/条数/MB)
    private double consumeAmount; // 消费金额
    private Date consumeDate;     // 消费日期

    public ConsumeInfo(String cardNumber, String type, int consumeData, double consumeAmount) {
        this.cardNumber = cardNumber;
        this.type = type;
        this.consumeData = consumeData;
        this.consumeAmount = consumeAmount;
        this.consumeDate = new Date();
    }

    @Override
    public String toString() {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        return "卡号:" + cardNumber +
                " 消费类型:" + type +
                " 消费数据量:" + consumeData +
                " 消费金额:" + consumeAmount + "元" +
                " 消费时间:" + sdf.format(consumeDate);
    }

    // Getter方法
    public String getCardNumber() {
        return cardNumber;
    }

    public String getType() {
        return type;
    }

    public int getConsumeData() {
        return consumeData;
    }

    public double getConsumeAmount() {
        return consumeAmount;
    }

    public Date getConsumeDate() {
        return consumeDate;
    }
}